#coding=utf-8

def selection_sort(data):
    for i in range(len(data)-1):
        min_index = i
        for j in range(i+1,len(data)):
            if data[j] < data[min_index]:
                min_index = j
        if min_index != i:
            data[i],data[min_index] = data[min_index],data[i]
    return data

if __name__ == '__main__':
    data = [10,17,50,7,30,24,27,45,15,5,36,21]
    selection_sort(data)
    print("排序后的数组：")
    for i in range(len(data)):
        print("%d"%data[i])